package com.ifar.audiosdk.utils

import com.alibaba.android.arouter.launcher.ARouter

object ARouterHandle {
    private const val main = "/app/MainActivity"
    private const val login: String = "/app/LoginActivity"
    private const val callIn: String = "/app/CallInActivity"
    private const val callOut: String = "/app/CallOutActivity"
    private const val call: String = "/app/CallActivity"

    /**主界面*/
    fun toMain() {
        ARouter.getInstance().build(main).navigation()
    }

    /**登录界面*/
    fun toLogin() {
        ARouter.getInstance().build(login).navigation()
    }

    /**呼入界面*/
    fun toCallIn(avatar: String, permission: String, name: String, id: String, channel: String) {
        ARouter.getInstance().build(callIn)
            .withString("avatar", avatar)
            .withString("permission", permission)
            .withString("name", name)
            .withString("id", id)
            .withString("channel", channel)
            .navigation()
    }

    /**呼出界面*/
    fun toCallOut(avatar: String, permission: String, name: String, id: String) {
        ARouter.getInstance().build(callOut)
            .withString("avatar", avatar)
            .withString("permission", permission)
            .withString("name", name)
            .withString("id", id)
            .navigation()
    }

    /**通话界面*/
    fun toCall(channelId: String, token: String) {
        ARouter.getInstance().build(call)
            .withString("channelId", channelId)
            .withString("token", token)
            .navigation()
    }
}

